import { createApp } from 'vue'
import './style.css'
import router from './router/router';
import { createPinia } from 'pinia';
import ElementPlus from "element-plus"
import "element-plus/dist/index.css"
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
import './tailwindcss.css'
import piniaPersist from "pinia-plugin-persist"
import axios from './axios'; // 引入封装的axios实例
import App from './App.vue'

const app = createApp(App);
app.config.globalProperties.$axios = axios; // 将axios挂载到全局
//自动引入图标
Object.keys(ElementPlusIconsVue).forEach((key)=>{
    app.component(key,ElementPlusIconsVue[key]);
});

const pinia = createPinia();
//持久化缓存
pinia.use(piniaPersist);
app.use(router).use(pinia).use(ElementPlus);
app.mount('#app');
